#include "summator.h"

Summator::Summator(QObject * parent):QObject(parent), m_a(0), m_b(0)
{
}

void Summator::setA(int a)
{
    if (m_a != a)
    {
        m_a = a;
        emit valueChanged();
    }
}

void Summator::setB(int b)
{
    if (m_b != b)
    {
        m_b = b;
        emit valueChanged();
    }
}

int Summator::sum() const
{
    return m_a + m_b;
}
